import axios from 'axios';

const http = axios.create({baseURL: 'http://127.0.0.1:33333/api/file_manage',timeout:2000});
http.interceptors.request.use(config => {
    const token = localStorage.getItem('token');
    if (token) {
        config.headers.Authorization = `Bearer ${token}`;
    }
    return config;
}, error => {
    window.location.href = '/login';
    return Promise.reject(error);
    }
)

export default http;